import java.util.Scanner;

/**
 * Created by Salted fish
 * Description:
 * User: 24539
 * Date：2021-07-30
 * Time: 0:01
 */

public class Test2 {
    public static void main(String[] args) {
        Scanner sn = new Scanner(System.in);
        int n = sn.nextInt();
        int add=facadd(n);
        System.out.println(add);
    }
    public static int facadd(int n) {
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int ret = 1;
            for (int j = 1; j <= i; j++) {
                ret *= j;
            }
            sum += ret;
        }
        return sum;
    }
}